x86/traps: Fix failed ASSERT() in do_guest_trap()
authorAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 10 Aug 2016 09:41:28 +0000 (10:41 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 10 Aug 2016 11:44:02 +0000 (12:44 +0100)
commit6480cc6280e955d1245d8dfb2456d2b830240c74
tree82962e5d208f3621a1a031005c13492af9f3ece8
parent9b3f9b9c30f8dc121fe1bbf915a31e46cb926e83
x86/traps: Fix failed ASSERT() in do_guest_trap()

c/s 2e426d6 "x86/traps: Drop use_error_code parameter from do_{,guest_}trap()"
introduced an assertion which covered the correctness of shifting 1u by an
input parameter.

While all other inputs provide a constants vector, the `int $N` handling path
from do_general_protection() passes any vector.

This path is triggered by XTF, which uses `int 0x20` to facilitate returning
to kernel mode after running specific tests in user mode.

No vectors above 32 have an error code, so adjust the logic to cope.

Reported-by: Wei Liu <wei.liu2@citrix.com>
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/traps.c